<template>
    <div class="assignHomework">
        <div class="title">
            布置作业
        </div>

        <div class="topbox">
            <div class="topbox_left">书写体/作业题</div>
            <div class="topbox_right">立即布置</div>
        </div>


        <div class="work_content">
            <div class="practicecontent">
                <el-form ref="form" :model="form" label-width="80px">
                    <el-form-item label="练习名称">
                        <el-input v-model="form.name" placeholder="请填写练习名称"></el-input>
                    </el-form-item>
                    <el-form-item label="练习内容">
                        <el-input v-model="form.content" placeholder="请填写练习内容"></el-input>
                    </el-form-item>
                </el-form>
            </div>


            <div class="uploadpic">
                <el-upload class="avatar-uploader" action="https://jsonplaceholder.typicode.com/posts/"
                    :show-file-list="false" :on-success="handleAvatarSuccess">
                    <img v-if="imageUrl" :src="imageUrl" class="avatar">
                    <div v-else class="uploadiconbox">
                        <img src="@/static/image/uoloadimg.png" alt="" srcset="">
                        <div>
                            图片
                        </div>
                    </div>
                </el-upload>
                <el-upload class="avatar-uploader" action="https://jsonplaceholder.typicode.com/posts/"
                    :show-file-list="false" :on-success="handleAvatarSuccess">
                    <img v-if="imageUrl" :src="imageUrl" class="avatar">
                    <div v-else class="uploadiconbox">
                        <img src="@/static/image/uploadyy.png" alt="" srcset="">
                        <div>
                            录音
                        </div>
                    </div>
                </el-upload>
                <el-upload class="avatar-uploader" action="https://jsonplaceholder.typicode.com/posts/"
                    :show-file-list="false" :on-success="handleAvatarSuccess">
                    <img v-if="imageUrl" :src="imageUrl" class="avatar">
                    <div v-else class="uploadiconbox">
                        <img src="@/static/image/uploadsp.png" alt="" srcset="">
                        <div>
                            视频
                        </div>
                    </div>
                </el-upload>
            </div>

            <div class="setTime_content">
                <div class="title">
                    定时发送：
                </div>
                <div class="tipbox">
                    设置时间
                </div>
                <div class="timebox">
                    <el-date-picker v-model="value1" type="datetime" placeholder="选择日期时间">
                    </el-date-picker>
                </div>
            </div>

        </div>



        <div class="studentContent">
            <div class="classListcontent">
                <div class="title">
                    选择学生：
                </div>

                <div class="list_content">
                    <div class="classNameitem" v-for="(item, index) in studentData" :key="index">
                        {{ item.className }}
                    </div>
                </div>
            </div>
            <div class="heng"></div>

            <div class="studentListcontent">
                <div class="studentitem" v-for="(studentitem, studentindex) in studentData[0].studentList"
                    :key="studentindex">
                    <img class="avatar" src="@/static/image/logo.png" alt="" srcset="">
                    <div class="studentmessage">
                        <div class="studentName">
                            {{ studentitem.name }}
                        </div>
                        <div class="studentmoblie">
                            {{ studentitem.moblie }}
                        </div>
                    </div>
                </div>
            </div>


        </div>


    </div>
</template>
<script>
export default {
    data() {
        return {
            form: {
                name: '',
                content: '',
            },
            imageUrl: '',
            value1: '',
            studentData: [{ className: 'L2-99', studentList: [{ name: "小明", moblie: "18456987456" },{ name: "小明", moblie: "18456987456" },{ name: "小明", moblie: "18456987456" },{ name: "小明", moblie: "18456987456" },{ name: "小明", moblie: "18456987456" },{ name: "小明", moblie: "18456987456" },{ name: "小明", moblie: "18456987456" }, { name: "小明", moblie: "18456987456" }, { name: "小明", moblie: "18456987456" }] },
            { className: '精英班', studentList: [{ name: "小明", moblie: "18456987456" }, { name: "小明", moblie: "18456987456" }, { name: "小明", moblie: "18456987456" }] }]
        }
    },
    created() {

    },
    mounted() {

    },
    methods: {
        onSubmit() {
            console.log('submit!');
        },
        handleAvatarSuccess(res, file) {
            console.log("file", file)
            this.imageUrl = URL.createObjectURL(file.raw);
        },

    }
}
</script>
<style scoped lang="scss">
.assignHomework {
    padding: 20px;
    box-sizing: border-box;

    .title {
        font-family: Alibaba PuHuiTi, Alibaba PuHuiTi;
        font-weight: 500;
        font-size: 14px;
        color: #5C5C5C;
        line-height: 16px;
    }

    .topbox {
        width: 100%;
        height: 72px;
        background: #FFFFFF;
        border-radius: 4px 4px 4px 4px;
        margin-top: 16px;
        padding: 16px;
        box-sizing: border-box;
        display: flex;
        align-items: center;
        justify-content: space-between;

        .topbox_left {
            font-family: PingFang SC, PingFang SC;
            font-weight: 500;
            font-size: 16px;
            color: #4BA840;
            line-height: 19px;
        }

        .topbox_right {
            cursor: pointer;
            width: 140px;
            height: 40px;
            background: #4BA840;
            border-radius: 4px 4px 4px 4px;
            font-family: PingFang SC, PingFang SC;
            font-weight: 500;
            font-size: 12px;
            color: #FFFFFF;
            line-height: 40px;
            text-align: center;
        }
    }

    .work_content {
        margin-top: 16px;
        width: 100%;
        // height: 360px;
        background: #FFFFFF;
        border-radius: 4px 4px 4px 4px;
        padding: 16px;
        box-sizing: border-box;

        .uploadpic {
            display: flex;
            margin-left: 75px;

            .avatar-uploader {
                margin-right: 20px;
            }

            .avatar-uploader .el-upload {
                border: 1px dashed #d9d9d9;
                border-radius: 6px;
                cursor: pointer;
                position: relative;
                overflow: hidden;
            }

            .avatar-uploader .el-upload:hover {
                border-color: #409EFF;
            }

            .avatar-uploader-icon {
                font-size: 28px;
                color: #8c939d;
                width: 78px;
                height: 78px;
                line-height: 78px;
                text-align: center;
            }

            .avatar {
                width: 78px;
                height: 78px;
                display: block;
            }

            .uploadiconbox {
                display: flex;
                align-items: center;
                font-family: PingFang SC, PingFang SC;
                font-weight: 400;
                font-size: 12px;
                color: #333333;
                line-height: 14px;
                text-align: center;

                img {
                    width: 24px;
                    height: 24px;
                }
            }
        }


        .setTime_content {
            display: flex;
            align-items: center;
            margin-top: 16px;

            .title {
                font-family: PingFang SC, PingFang SC;
                font-weight: 400;
                font-size: 12px;
                color: #333333;
                line-height: 14px;
            }

            .tipbox {
                width: 94px;
                height: 37px;
                background: #EAF9E8;
                border-radius: 4px 4px 4px 4px;
                font-family: PingFang SC, PingFang SC;
                font-weight: 400;
                font-size: 12px;
                color: #4BA840;
                line-height: 37px;
                text-align: center;
                margin: 0 12px;
            }

            .timebox {}
        }

    }




    .studentContent {
        margin-top: 16px;
        width: 100%;
        min-height: 360px;
        background: #FFFFFF;
        border-radius: 4px 4px 4px 4px;
        padding: 16px;
        box-sizing: border-box;

        .classListcontent {
            display: flex;
            align-items: center;

            .title {
                font-family: PingFang SC, PingFang SC;
                font-weight: 500;
                font-size: 14px;
                color: #333333;
                line-height: 16px;
            }

            .list_content {
                display: flex;
                align-items: center;

                .classNameitem {
                    width: 110px;
                    height: 37px;
                    border-radius: 4px 4px 4px 4px;
                    border: 1px solid #AAAAAA;
                    font-family: PingFang SC, PingFang SC;
                    font-weight: 400;
                    font-size: 14px;
                    color: #AAAAAA;
                    line-height: 37px;
                    text-align: center;
                    margin-right: 10px;
                    cursor: pointer;
                }
            }
        }

        .heng {
            width: 100%;
            height: 1px;
            background-color: #EEEEEE;
            margin: 16px 0;
        }

        .studentListcontent {
            width: 100%;
            display: flex;
            flex-wrap: wrap;

            .studentitem {
                width: 217px;
                height: 70px;
                border-radius: 4px 4px 4px 4px;
                border: 1px solid #AAAAAA;
                display: flex;
                align-items: center;
                padding: 10px;
                box-sizing: border-box;
                margin-left: 13px;
                margin-bottom: 16px;
                cursor: pointer;

                .avatar {
                    width: 44px;
                    height: 44px;
                    border-radius: 44px;
                }

                .studentmessage {
                    margin-left: 10px;

                    .studentName {
                        font-family: PingFang SC, PingFang SC;
                        font-weight: 400;
                        font-size: 12px;
                        color: #333333;
                        line-height: 20px;
                    }

                    .studentmoblie {
                        font-family: PingFang SC, PingFang SC;
                        font-weight: 400;
                        font-size: 12px;
                        color: #777777;
                        line-height: 20px;
                    }
                }
            }
        }


    }
}
</style>